using System;
using System.Collections.Generic;
using System.Text;
using Buka.BLL.Model;

namespace Buka.BLL.Provider
{
    [System.ComponentModel.DataObject()]
    public class MasterTypeProvider
    {

        #region "Fill & Get"

        public void FillObjectFromDataRow(Buka.DAL.Masters.Master_TypesRow row, MasterType obj)
        {
            obj.Id = row.id;
            obj.Caption = row.caption;
            if (row.IsdescriptionNull())
            {
                obj.Description = "";
            }
            else
            {
                obj.Description = row.description;
            }
        }

        public MasterType GetObjectFromDataRow(Buka.DAL.Masters.Master_TypesRow row)
        {
            MasterType masterType = new MasterType();
            try
            {
                masterType = GetObjectFromDataRow(row);
            }
            catch (Exception ex)
            {
                throw new ArgumentException(ex.Message);
            }
            return masterType;
        }
        #endregion
    }
}
